package com.niuke;

import java.util.ArrayList;
import java.util.Comparator;
import java.util.List;
import java.util.Scanner;

/**
 * 16. 最佳植树距离
 * https://blog.csdn.net/qq_34143141/article/details/131466295
 */
public class NiukeMoni17buhui {

    public static void main(String[] args) {

        Scanner scanner = new Scanner(System.in);

        int positionCount = Integer.parseInt(scanner.nextLine());

        List<Integer> position = new ArrayList<>();
        String[] positionStr = scanner.nextLine().split(" ");
        for (int i = 0; i < positionCount; i++) {
            position.add(Integer.parseInt(positionStr[i]));
        }
        position.sort(new Comparator<Integer>() {
            @Override
            public int compare(Integer integer, Integer t1) {
                return integer - t1;
            }
        });

        int shu = Integer.parseInt(scanner.nextLine());

        int maxJianGe = position.get(position.size() - 1) - position.get(0);
        int res = 0;
        if (shu == 2) {
            res = maxJianGe;
        } else if (shu >= position.size()) {
            res = maxJianGe;
            for (int i = 0; i < position.size() - 1; i++) {
                res = Math.min(res, position.get(i + 1) - position.get(i));
            }
        } else if (shu > 2 && shu < position.size()) {
            int liXiangRes = maxJianGe / (shu - 1); // 种不满的情况下的理想间隔
            res = liXiangRes;
            int p = position.get(0);
            int index = 0;
            while (p < position.size()) {
                if (position.contains(p + liXiangRes)) {
                    p = p + liXiangRes;
                    res = Math.min(res, liXiangRes);
                } else {
                    while (position.get(index) < p + liXiangRes) {
                        index++;
                    }
                }
            }
        }
        System.out.println(res);

    }

}
